<template>
	<view class="setting">
		<view class="status_bar"></view>
		<view class="header">
			<view class="status_title">
				<image class="status_left" src="/static/img/arr-left.png" mode="widthFix" @click="back"></image>
				<view class="status_center">设置</view>
				<text></text>
			</view>
		</view>
		<view class="content">
			<wu-cell title="个人信息设置" isLink url="/pages/setting/user-setting"></wu-cell>
			<wu-cell title="修改密码" isLink url="/pages/setting/changePassword"></wu-cell>

			<view class="systemcache-cell">
				<wu-cell title="清除系统缓存" isLink @click="clearCache"></wu-cell>
				<!-- <text class="text">缓存是使用过程中产生的临时数据，清理后不影响正常使用</text> -->
			</view>
			<wu-cell title="关于我们" isLink></wu-cell>
		</view>
		<!-- 是否清除缓存的弹窗 -->
		<fui-dialog :show="showDialog" title="" content="请确认是否清理所有系统缓存?" contentColor="rgba(255, 64, 64, 1)" maskClosable @click="handleDialog"></fui-dialog>
		<view class="footer">
			<wu-cell title="退出登录"  @click="handleLogout"></wu-cell>
		</view>
	</view>
</template>

<script>
import FuiDialog from '@/components/fui-dialog/fui-dialog.vue';
export default {
	components: {
		FuiDialog
	},
	data() {
		return {
			showDialog: false //清除系统缓存的弹窗
		};
	},
	onLoad() {},
	methods: {
		gosetting() {
			uni.navigateTo({
				url: '/pages/setting/setting'
			});
		},
		back() {
			uni.navigateBack();
		},
		//清除系统缓存
		clearCache() {
			this.showDialog = true;
		},
		handleDialog(value) {
			this.showDialog = false;
		},
		handleLogout() {
			uni.clearStorage();
			uni.reLaunch({
				url: '/pages/login/index'
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.setting {
	background-color: #f2f3f7;
	.header {
		.status_bar {
			height: var(--status-bar-height);
			width: 100%;
		}
		/* 自定义导航栏 */
		.status_title {
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;
			align-items: center;
			width: 100%;
			height: 100.061rpx;
			padding: 0 16px;
			background-color: #ffffff;
		}
		.status_left {
			width: 24px !important;
		}
		.status_center {
			font-size: 17px;
			font-weight: 700;
		}
		.status_right {
			width: 22px;
		}
	}

	.content {
		margin-top: 19.084rpx;
		::v-deep {
			.wu-cell {
				background-color: #fff;
			}
			.wu-cell__body {
				padding: 20px !important ;
			}
			.wu-cell__title-text {
				font-size: 20rpx;
			}
		}
	}

	.footer {
		background-color: #fff;
		margin-top: 19.084rpx;
		font-size: 32rpx;
		::v-deep {
			.wu-cell__title-text {
				font-size: 32rpx;
				text-align: center;
				color: #ff0000;
			}
			.wu-cell__body {
				padding: 25px !important ;
			}
		}
	}
}
</style>
